home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / bsrc_250.zip / B_SCRIPT.C < prev    next >
C/C++ Source or Header  |  1991-09-15  |  26KB  |  764 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*               This module was written by Vince Perriello                 */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*                    BinkleyTerm Script Handler Module                     */
  17. /*                                                                          */
  18. /*                                                                          */
  19. /*    For complete  details  of the licensing restrictions, please refer    */
  20. /*    to the License  agreement,  which  is published in its entirety in    */
  21. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  22. /*                                                                          */
  23. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  24. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  25. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  26. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  27. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  28. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  29. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  30. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  31. /*                                                                          */
  32. /*                                                                          */
  33. /* You can contact Bit Bucket Software Co. at any one of the following      */
  34. /* addresses:                                                               */
  35. /*                                                                          */
  36. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  37. /* P.O. Box 460398                AlterNet 7:491/0                          */
  38. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  39. /*                                Internet f491.n343.z1.fidonet.org         */
  40. /*                                                                          */
  41. /* Please feel free to contact us at any time to share your comments about  */
  42. /* our software and/or licensing policies.                                  */
  43. /*                                                                          */
  44. /*--------------------------------------------------------------------------*/
  45.  
  46. /* Include this file before any other includes or defines! */
  47.  
  48. #include "includes.h"
  49.  
  50. int nextline (char *);
  51. int get_line (void);
  52.  
  53.  
  54. /*--------------------------------------------------------------------------*/
  55. /*   Define our current script functions for use in our dispatch table.     */
  56. /*--------------------------------------------------------------------------*/
  57.  
  58. int script_port (void);                          /* Chang the port being used */
  59. int script_upload (void);                        /* Upload files              */
  60. int script_download (void);                      /* Download files            */
  61. int script_baud (void);                          /* Set our baud rate to that
  62.                                                   * of remote */
  63. int script_xmit (void);                          /* transmit characters out
  64.                                                   * the port   */
  65. int script_rawxmit (void);                       /* transmit characters out
  66.                                                   * the port (no translation) */
  67. int script_pattern (void);                       /* define a pattern to wait
  68.                                                   * for       */
  69. int script_wait (void);                          /* wait for a pattern or
  70.                                                   * timeout      */
  71. int script_dial (void);                          /* dial the whole number at
  72.                                                   * once      */
  73. int script_areacode (void);                      /* transmit the areacode out
  74.                                                   * the port */
  75. int script_phone (void);                         /* transmit the phone number */
  76. int script_carrier (void);                       /* Test point, must have
  77.                                                   * carrier now  */
  78. int script_session (void);                       /* Exit script
  79.                                                   * "successfully"         */
  80. int script_if (void);                            /* Branch based on pattern
  81.                                                   * match      */
  82. int script_goto (void);                          /* Absolute branch           */
  83. int script_timer (void);                         /* Set a master script
  84.                                                   * timeout        */
  85. int script_bps100 (void);                        /* Send BPS/100 to remote
  86.                                                   * system      */
  87. int script_break (void);                         /* Send a break to remote
  88.                                                   * system      */
  89. int script_params (void);                        /* Set communication
  90.                                                   * parameters       */
  91. int script_DOS (void);                           /* Execute a DOS command */
  92. int script_abort (void);                         /* Abort a script during
  93.                                                   * certain hours */
  94. int script_noWaZOO (void);                       /* Turn off WaZOO for this
  95.                                                   * session only */
  96. struct dispatch
  97. {
  98.    char *string;
  99.    int (*fun) (void);
  100. };
  101.  
  102. static struct dispatch disp_table[] = {
  103.                                 {"download", script_download},
  104.                                 {"upload", script_upload},
  105.                                 {"baud", script_baud},
  106.                                 {"xmit", script_xmit},
  107.                                 {"rawxmit", script_rawxmit},
  108.                                 {"pattern", script_pattern},
  109.                                 {"wait", script_wait},
  110.                                 {"dial", script_dial},
  111.                                 {"areacode", script_areacode},
  112.                                 {"phone", script_phone},
  113.                                 {"carrier", script_carrier},
  114.                                 {"session", script_session},
  115.                                 {"if", script_if},
  116.                                 {"goto", script_goto},
  117.                                 {"timer", script_timer},
  118.                                 {"speed", script_bps100},
  119.                                 {"break", script_break},
  120.                                 {"comm", script_params},
  121.                                 {"dos", script_DOS},
  122.                                 {"abort", script_abort},
  123.                                 {"port", script_port},
  124.                                 {"NoWaZOO", script_noWaZOO},
  125. #ifndef MILQ
  126.                                 {(char *)NULL, NULL}
  127. #else
  128.